package com.huawei.gamebox.service.common.cardkit.node;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.widget.LinearLayout;
import com.huawei.appgallery.foundation.ui.framework.widget.Space;
import com.huawei.gamebox.service.common.cardkit.card.LeavesFlatpCard;
import o.chc;
import o.cih;
import o.exp$a;
import o.exp.d;
import o.exp.j;

public class LeavesFlatpNode extends BaseGsNode {
    public LeavesFlatpNode(Context context) {
        super(context);
    }

    public int ˏ() {
        return chc.ˎ();
    }

    public boolean ˊ(ViewGroup viewGroup, ViewGroup viewGroup2) {
        int i;
        LayoutInflater from = LayoutInflater.from(this.ॱ);
        View inflate = from.inflate(j.ᐝˋ, null);
        LinearLayout linearLayout = (LinearLayout) inflate.findViewById(d.ʹ);
        LayoutParams layoutParams = new LinearLayout.LayoutParams(this.ॱ.getResources().getDimensionPixelSize(exp$a.ʽॱ), -1);
        int ˏ = ˏ();
        for (i = 0; i < ˏ; i++) {
            View inflate2 = from.inflate(j.ᐧ, null);
            cih leavesFlatpCard = new LeavesFlatpCard(this.ॱ);
            leavesFlatpCard.ˋ(ˏ);
            leavesFlatpCard.ˏ(inflate2);
            ˊ(leavesFlatpCard);
            linearLayout.addView(inflate2);
            if (i < ˏ - 1) {
                linearLayout.addView(new Space(this.ॱ), layoutParams);
            }
        }
        i = this.ॱ.getResources().getDimensionPixelSize(exp$a.ʾ);
        linearLayout.setPadding(i, 0, i, 0);
        viewGroup.addView(inflate);
        return true;
    }
}
